﻿/*===================================================
* CLR版本  : 4.0.30319.42000 
* 类名称   : HomeFactory
* 文 件 名 : HomeFactory 
* 类描述   :
* 创建人   : oream
* 创建时间 : 2018/3/10 20:39:48
* 修改人   : 
* 修改时间 :
* 版本： @version 1.0
=====================================================*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace Model
{
  [UiFactory(EUitype.Home)]
  public class HomeFactory : IUiFactory
  {
    public UI Create(Scene scene, EUitype uitype, GameObject ParentObject)
    {
      GameObject homeObject = Resources.Load<GameObject>("Home");
      GameObject go = GameObject.Instantiate<GameObject>(homeObject);
      UI ui = EntityFactory.Cerate<UI, UI, GameObject>(null, go);
      ui.AddComponent<HomeComponent>();
      return ui;
    }

    public void Remove(EUitype uitype)
    {
      UI ui = UIComponentHelper.GetUI(uitype);
      ui.RemoveComponent<HomeComponent>();
    }
  }
}
